﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace CSharpDemo
{
    /// <summary>
    /// 类型：电脑
    /// </summary>
    public class DianNao
    {
        /// <summary>
        /// 主板
        /// </summary>
        public Zhuban myZhuban;

        /// <summary>
        /// 内存
        /// </summary>
        public Neicun myNeiCun;

        /// <summary>
        /// 处理器
        /// </summary>
        public CPU myCpu;


        /// <summary>
        /// 电源
        /// </summary>
        public Dianyuan power;


        /// <summary>
        /// 开机
        /// </summary>
        public void PowerOn()
        {
            if (power == null)
            {
                MessageBox.Show("不行，没有电");
            }
            else if (myZhuban == null)
            {
                MessageBox.Show("不行，没有主板");
            }
            else if (myCpu == null)
            {
                MessageBox.Show("不行，没有CPU");
            }
            else if (myNeiCun == null)
            {
                MessageBox.Show("不行，没有内存");
            }
            else
            {
                MessageBox.Show("正在开机中......");
            }
        }

    }
}
